/*
 * GStandingsRankType.java
 * Created on 29 déc. 07
 *
 * Glacéo Internet Platform
 * http://sourceforge.net/projects/chm/
 *
 * Copyright (c) 2005-2007, Jan Janke (VirtualHockey Project)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hockeo.vhbase.data.helper;

/**
 * Represents the type of rank (promoted, midfield, relegated) of a standings object.
 *
 * @version $Id$
 * @author jjanke
 */
public enum GStandingsRankType
{
  /**
   * Applied to teams ranked in the range of the CL qualification places.
   */
  QUALIFIED_EU1( 1, "standingsLine1", "images/contests/eu1_16.png" ),

  /**
   * Applied to teams ranked in the range of the IC qualification places.
   */
  QUALIFIED_EU2( 2, "standingsLine2", "images/contests/eu2_16.png" ),

  /**
   * Applied to teams ranked in the range of the promoted category 1.
   */
  PROMOTED_1( 3, "standingsLine1", "images/icons/rank_improved.gif" ),

  /**
   * Applied to teams ranked in the range of the promoted category 2.
   */
  PROMOTED_2( 4, "standingsLine2", "images/icons/rank_improved.gif" ),

  /**
   * Applied to everyone that is neither promoted nor relegated.
   */
  MIDFIELD( 5, "standingsLine3", "images/icons/rank_unchanged.gif" ),

  /**
   * Applied to teams ranked in the relegation zone.
   */
  RELEGATED( 6, "standingsLine4", "images/icons/rank_degraded.gif" );

  private int    d_nPriority;
  private String d_strCssClass;
  private String d_strIconPath;

  /** No-arg constructor for GWT/RPC. */
  private GStandingsRankType()
  {}

  /**
   * Creates a new GStandingsRankType constant.
   *
   * @param nPriority the priority of the rank type (the lower the better)
   * @param strCSSClass the name of the CSS class
   * @param strIconPath the path to the icon used to represent the rank type
   */
  private GStandingsRankType( int nPriority, String strCSSClass, String strIconPath )
  {
    d_nPriority = nPriority;
    d_strCssClass = strCSSClass;
    d_strIconPath = strIconPath;
  }

  /**
   * Returns the rank type's priority.
   */
  public int getPriority()
  {
    return d_nPriority;
  }

  /**
   * Returns the name of the matching CSS class.
   */
  public String getCssClass()
  {
    return d_strCssClass;
  }

  /**
   * The path (after the application root) to the icon representing the rank type in
   * historical views.
   */
  public String getIconPath()
  {
    return d_strIconPath;
  }
}
